package com.mode.simple.factory;

/**
 * @Description: 工厂方法
 * @Author: zyf
 * @Time: 2020/9/27 10:50
 */
public class TestMain {

    public static void main(String[] args) {
        Person blackPerson = null;
        try {
            blackPerson = PersonFactory.getPerson("com.mode.simple.factory.BlackPerson");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }
        System.out.println(blackPerson.color);
        System.out.println(blackPerson.showSpeciality());
    }
}
